function SqlCon(sContainerId) {
	this.sContainerId = sContainerId;
	this.init();
};

SqlCon.prototype = {
	
	init: function () {
		var oMe = this;
		this.jTextarea = $('#' + this.sContainerId);
		this.attachEvents();
	},

	attachEvents: function () {
		var oMe = this;
		this.jTextarea.keydown(function(e) {
			return oMe.onKeydown(e);
		});
	},

	onKeydown: function (e) {
		if (e.keyCode == 9) {
			return this.autocomplete();
		}
	},
	
	autocomplete: function () {
		var aText = this.jTextarea.val().split(' ');
		var sWord = aText[aText.length-1];
		console.log(sWord);
		
		this.jTextarea.val('SELECT * FROM `` WHERE 1 LIMIT 50;');
		
		var inputObject = this.jTextarea.get(0);
		if (inputObject.selectionStart) {
			inputObject.setSelectionRange(15,15);
			inputObject.focus();
		}
		
		return false;
	}
	
	
};